﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using CreditAgricole.Framework;

namespace CreditAgricole.PageCodeBehind
{
    public partial class CriteriaMenuItem : UserControl
    {
        protected Panel pnlHiddenCriteria;
        protected ElementMenu criteria1;
        protected ElementMenu criteria2;

        public string Criteria1Title
        {
            get { return criteria1.LblElement; }
            set { criteria1.LblElement = value; }
        }
        
        public string Criteria2Title
        {
            get { return criteria2.LblElement; }
            set { criteria2.LblElement = value; }
        }

        public string Criteria1Link
        {
            get { return criteria1.LinkElement; }
            set { criteria1.LinkElement = value; }
        }

        public string Criteria2Link
        {
            get { return criteria2.LinkElement; }
            set { criteria2.LinkElement = value; }
        }

        public void Select(Constants.ElementsMenuCriteria selectedCriteria)
        {
            pnlHiddenCriteria.Visible = true;
            switch (selectedCriteria)
            {
                case Constants.ElementsMenuCriteria.FirstCriteria:
                    {
                        criteria1.Selected();
                        break;
                    }
                case Constants.ElementsMenuCriteria.SecondCriteria:
                    {
                        criteria2.Selected();
                        break;
                    }
            }
        }
    }
}
